package com.yawn.zdweb.project;

import com.yawn.zdweb.entity.Project;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "zd-project", fallback = ProjectServiceImpl.class)
public interface ProjectService {

    @GetMapping("/project/getAll")
    List<Project> findAll();

    @PostMapping("/project/add")
    void save(@RequestBody Project project);

    @PostMapping("/project/delete")
    void delete(@RequestBody Project pro);

    @GetMapping("/project/prefer")
    Project getPreferPro();

    @GetMapping("/project/getOne")
    Project findOne(@RequestParam("code") String code);

    @PostMapping("/project/prefer")
    boolean setPreferPro(@RequestParam("code") String code);
}
